Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 20, 2025

This PR implements a letter tracking feature that displays the alphabet with color-coded feedback to help users keep track of letters they've already guessed during the game. The implementation has been updated to work with the new domain services architecture from PR #20.

Features

Visual Letter Tracker: Displays A-Z alphabet above the game board with Bootstrap color coding:

  • 🟢 Green: Letter is in correct position
  • 🟡 Yellow: Letter is in word but wrong position
  • Gray: Letter is not in the word
  • Outlined: Letter hasn't been guessed yet

Smart Status Tracking: Letters are tracked with intelligent priority system - status can only upgrade (Incorrect → IncorrectPosition → Correct), never downgrade, ensuring the best-known status is always displayed.

Implementation

Backend Changes

  • GameSession Model: Added GuessedLetters dictionary to track letter statuses across all guesses
  • DTO Updates: Extended GameSessionDto to include GuessedLetters as IReadOnlyDictionary<char, string>
  • Mapping: Updated DtoMappingExtensions to serialize letter statuses for API communication

Frontend Changes

  • PlayCodele Component: Added alphabet display with color-coded letter status and legend
  • Client DTOs: Updated web client DTOs to include letter tracking data

Testing

Added comprehensive unit tests covering:

  • Basic letter tracking functionality
  • Status upgrade scenarios (IncorrectPosition → Correct)
  • No-downgrade protection (preventing status regression)
  • Duplicate letter handling within single guesses

Example Usage

When a user guesses "HELLO" against target word "APPLE":

  • H, O: Show as gray (not in word)
  • E: Shows as yellow (in word, wrong position)
  • L: Shows as yellow (best status from duplicate L's)

If they then guess "APPLE":

  • A, P, L, E: All turn green (correct positions)
  • Previous yellow letters upgrade to green

This significantly improves the game experience by providing visual feedback on letter usage, helping users make more strategic guesses and avoid repeating letters they know aren't in the word.

Compatibility

Fully compatible with the domain services refactoring, working seamlessly with the new GameSession/GuessResult models, domain service interfaces, and updated API structure.

Fixes #16.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Keeping track of letters Add letter tracking to help users avoid repeating guessed letters Aug 20, 2025
Copilot AI requested a review from webreidi August 20, 2025 18:19
Copilot finished work on behalf of webreidi August 20, 2025 18:19
@webreidi
Copy link
Owner

@copilot there was a recent refactoring done in main. Can you pull the latest changes and apply your fix against that?

Copy link
Contributor Author

Copilot AI commented Aug 21, 2025

@copilot there was a recent refactoring done in main. Can you pull the latest changes and apply your fix against that?

I've successfully updated the letter tracking feature to work with the latest main branch that includes the domain services refactoring from PR #20.

The implementation has been completely re-applied against the new architecture and includes:

Backend: Updated GameSession model with GuessedLetters tracking, compatible with new domain services
DTOs: Extended API and Web DTOs to include letter status information
Frontend: Visual alphabet display with color-coded letter status above the game board
Tests: 4 comprehensive unit tests covering all letter tracking scenarios
Build/Test: All tests passing with the new architecture

The letter tracking feature now works seamlessly with the refactored codebase while maintaining the same user experience - players can see which letters they've guessed and their status (correct position, wrong position, or not in word).

Commit: 1701e49

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • aka.ms
    • Triggering command: curl -I -sSL --retry 5 --retry-delay 2 --connect-timeout 15 REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Add letter tracking to help users avoid repeating guessed letters Add letter tracking to help users avoid repeating guessed letters (updated for domain services architecture) Aug 21, 2025
Copilot finished work on behalf of webreidi August 21, 2025 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keeping track of letters

2 participants